/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ihc.terminalbanco;

import ihc.terminalbanco.gui.FrameTerminal;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridLayout;
import java.util.ArrayList;
import javax.swing.JFrame;
import javax.swing.SpringLayout;
import ihc.terminalbanco.gui.panels.SpringUtilities;
import ihc.terminalbanco.gui.buttons.LabelButton;
import ihc.terminalbanco.gui.events.Events;
import ihc.terminalbanco.gui.events.KeyActions;
import ihc.terminalbanco.gui.panels.AguardePane;
import ihc.terminalbanco.gui.panels.BemVindoPane;
import ihc.terminalbanco.gui.panels.ConstructMenusPanels;
import ihc.terminalbanco.gui.panels.InformeAgendaPane;
import ihc.terminalbanco.gui.panels.RetireSeuDinheiroPane;
import ihc.terminalbanco.gui.panels.SaldoPane;
import ihc.terminalbanco.gui.panels.SaqueOutroValorPane;
import ihc.terminalbanco.gui.panels.TerminalPane;
import ihc.terminalbanco.gui.panels.TerminoComprovantePane;

import ihc.terminalbanco.testDatas.Datas;
import javax.swing.JPanel;

/**
 * @author Rafael
 */
public class Main {

	/**
	 * @param args
	 *            the command line arguments
	 */
	public static void main(String[] args) {
                Datas coletandoDados = new Datas();

            if (args.length > 0) {
                coletandoDados.setModoTeste(true);
            } else {
                coletandoDados.setModoTeste(false);
            }


                ConstructMenusPanels.keyListener = new KeyActions(coletandoDados);

                KeyActions keyActions = ConstructMenusPanels.keyListener;
                ConstructMenusPanels.keyListener = keyActions;

                ConstructMenusPanels.actionListener = new Events(keyActions,coletandoDados);
                
                Events events = ConstructMenusPanels.actionListener;
                
		JFrame terminalFrame = new FrameTerminal("Terminal de Atendimento - Banco do Povo",coletandoDados);
		terminalFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		terminalFrame.setResizable(true);
		Dimension dimensaoInicial = new Dimension(640, 480);
		terminalFrame.setMinimumSize(dimensaoInicial);
                terminalFrame.addKeyListener(keyActions);


                JPanel menuPrincipal = ConstructMenusPanels.constructMainMenu();                           
                events.setMenuPrincipalPanel(menuPrincipal);
                
                JPanel bemVindoPanel = new BemVindoPane(events, new Font(Font.SANS_SERIF,Font.PLAIN,30));
                terminalFrame.setContentPane(bemVindoPanel);
                events.setAtualPanel(bemVindoPanel);
                events.setBemVindoMenuPanel(bemVindoPanel);

                keyActions.inicializaKeyAction(events);
                terminalFrame.setVisible(true);

                events.setFrameInterface(terminalFrame);
                coletandoDados.setStartTime();
                terminalFrame.setFocusable(true);
                terminalFrame.setVisible(true);
	}
}
